// 用户相关API
import request from '@/utils/request'

// ======================================== 框架所需API ========================================

// 用户登录
export function login(data) {
  return request({
    url: '/api/User/AuthLogin',
    method: 'get',
    params: data
  })
}

// 获取用户详情
export function getInfo(params) {
  return request({
    url: '/api/User/LoginUserDetail',
    method: 'post',
    data: params
  })
}

// ======================================== 业务所需API ========================================


// 获取用户列表
export const UserList = (data) => {
  return request({
    url: '/api/User/UserList',
    method: 'post',
    data
  })
}

// 获取用户详情
export const UserDetail = (data) => {
  return request({
    url: '/api/User/UserDetail',
    method: 'post',
    data
  })
}

// 提交用户信息
export const SubmitUser = (data) => {
  return request({
    url: '/api/User/SubmitUser',
    method: 'post',
    data
  })
}

// 启用或禁用用户
export const UpdateUserStatus = (data) => {
  return request({
    url: "/api/User/UpdateUserStatus",
    method: 'post',
    data
  })
}

// 批量删除用户信息
export const DelUser = (data) => {
  return request({
    url: "/api/User/DelUser",
    method: 'post',
    data
  })
}


export const getUserMenu = (seriesId) => {
  return request({
    url: `/JwtAPI/AuthAsync/GetPermission?seriesId=${seriesId}&MenuCategory=1`,
    method: 'get',
  })
}

export const getUserButton = (id,btnType) => {
  return request({
    url: `/JwtAPI/AuthAsync/GetButtonPermission?menuId=${id}&btnType=${btnType}`,
    method: 'get',
  })
}

